package 耿翔宇;

import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import cn.hutool.core.io.FileUtil;

public class CallName03 {

	public static void main(String[] args) {
		RandomRollCall();
	}

	private static void RandomRollCall() {
		String n = "����";
		File file = new File("randomcall03.txt");
		List<String> info = FileUtil.readLines(file, "utf-8");
		List<String> name = new ArrayList<>();
		if((info.size()+1)%3==0){
			name.add(n);
		}else{
			List<String> allInfo = FileUtil.readLines(new File("names.txt"), "utf-8");			
			Collections.shuffle(allInfo);		
			name.add(allInfo.get(0).split("-")[0]);
		}	
		System.out.println(name.get(0));
		FileUtil.writeLines(name, file, "utf-8",true);
	}
}
